package com.walsai.pcsys.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.walsai.pcsys.core.model.User;
import com.walsai.pcsys.core.service.SolutionManager;

public class ResultController extends AbstractController{
	
	private SolutionManager solutionManager;

	public void setSolutionManager(SolutionManager solutionManager){
		this.solutionManager = solutionManager;
	}
	
	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		HttpSession session = request.getSession();
		return new ModelAndView("resultsView","resultModel",
				this.solutionManager.getSolutions((User)session.getAttribute("userInfo")));
		
	}
	
}